﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ITAP.ShprossesBuilder.Modelling.Components.Constraints
{
    [Serializable]
    public class CutAngleConstraintConnected : IConstraint
    {
        private bool enabled = true;
        private ConstraintAction action = ConstraintAction.Fix;
        private Type typeOfConnectedComponent;
        private Type typeOfConnectedConnectedComponent;

        public CutAngleConstraintConnected(Type typeOfConnectedComponent, Type typeOfConnectedConnectedComponent)
        {
            this.typeOfConnectedComponent = typeOfConnectedComponent;
            this.typeOfConnectedConnectedComponent = typeOfConnectedConnectedComponent;
        }
        #region IConstraint Members

        public bool Check(IComponent component)
        {
            foreach (IComponent connectedComponent in component.ConnectedComponents)
            {
                if (connectedComponent.GetType() != typeOfConnectedComponent) continue;

                foreach (IComponent connectedConnectedComponent in connectedComponent.ConnectedComponents)
                {
                    if (connectedConnectedComponent.GetType() != typeOfConnectedConnectedComponent) continue;


                }

            }
            throw new NotImplementedException();
        }

        public void Fix(IComponent component)
        {
            throw new NotImplementedException();
        }

        public bool Enabled
        {
            get
            {
                return enabled;
            }
            set
            {
                enabled = value;
            }
        }

        public ConstraintAction Action
        {
            get { return action; }
        }

        #endregion

        #region IConstraint Members

        #endregion

        #region ICloneable Members

        public object Clone()
        {
            CutAngleConstraintConnected clone = new CutAngleConstraintConnected(typeOfConnectedComponent, typeOfConnectedConnectedComponent);
            return clone;
        }

        #endregion
    }
}
